package dao.auth.mybatis;

import java.util.List;

import model.auth.Roles;
import model.auth.Users;

import org.springframework.stereotype.Repository;

import dao.MyBatisBaseDao;
import dao.auth.UsersRolesDao;

@Repository("auth.UsersRolesDao")
public class UsersRolesDaoImpl extends MyBatisBaseDao implements UsersRolesDao {

	public List<Roles> getRolesByUserId(Long userId) {
		List<Roles> roles = getSqlSessionTemplate().selectList("auth.UsersRolesMapper.getRolesByUserId", userId);
		return roles;
	}

	public List<Users> getUsersByRoleId(Long roleId) {
		List<Users> users = getSqlSessionTemplate().selectList("auth.UsersRolesMapper.getUsersByRoleId", roleId);
		return users;
	}

	
}
